﻿' Copyright © Microsoft Corporation.  All Rights Reserved.
' This code released under the terms of the 
' Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)
' <copyright file="ScriptableObservableCollection.vb" company="Microsoft">
'     Copyright © Microsoft Corporation. All rights reserved.
' </copyright>
' <summary>Implements a Scriptable version of the ObservableCollection class</summary>
' <author>Microsoft Expression Encoder Team</author>

Imports Microsoft.VisualBasic
Imports System.Windows
Imports System.Windows.Browser
Imports System.Windows.Media

Namespace ExpressionMediaPlayer
	<ScriptableType> _
	Public Class ScriptableTimelineMarkerRoutedEventArgs
		Inherits RoutedEventArgs
		''' <summary>
		''' event args for when timeline marker reached
		''' </summary>
		''' <param name="marker"></param>
		Public Sub New(ByVal marker As ScriptableTimelineMarker)
			Me.Marker = marker
		End Sub

		Private privateMarker As ScriptableTimelineMarker
		Public Property Marker() As ScriptableTimelineMarker
			Get
				Return privateMarker
			End Get
			Set(ByVal value As ScriptableTimelineMarker)
				privateMarker = value
			End Set
		End Property
	End Class

	Public Delegate Sub ScriptableTimelineMarkerRoutedEventHandler(ByVal sender As Object, ByVal e As ScriptableTimelineMarkerRoutedEventArgs)

	<ScriptableType> _
	Public Class ScriptableTimelineMarker
		''' <summary>
		''' text of marker
		''' </summary>
		Private privateText As String
		Public Property Text() As String
			Get
				Return privateText
			End Get
			Set(ByVal value As String)
				privateText = value
			End Set
		End Property
		''' <summary>
		''' time of marker (seconds)
		''' </summary>
		Private privateTime As Double
		Public Property Time() As Double
			Get
				Return privateTime
			End Get
			Set(ByVal value As Double)
				privateTime = value
			End Set
		End Property
		''' <summary>
		''' type of marker
		''' </summary>
		Private privateType As String
		Public Property Type() As String
			Get
				Return privateType
			End Get
			Set(ByVal value As String)
				privateType = value
			End Set
		End Property
		''' <summary>
		''' create new ScriptableTimelineMarker from TimelineMarker
		''' </summary>
		''' <param name="marker"></param>
		Public Sub New(ByVal marker As TimelineMarker)
			Text = marker.Text
			Time = marker.Time.TotalSeconds
			Type = marker.Type
		End Sub
	End Class
End Namespace
